<template>
  <div :key="key">
    <center>
      <h3>南京市养老机构综合机构床位建设补贴申请表</h3>
    </center>
    <!-- 基本信息 -->
    <table align="center" border="1" cellpadding="5" cellspacing="0" width="100%" class="table1">
      <caption>基本信息</caption>
        <tr>
          <td width="20%">机构名称</td>
          <td>{{ data.organizationName }}</td>
          <td width="20%">申请类型</td>
          <td>{{data.applyTypeLabel}}</td>
        </tr>
        <tr>
          <td>机构类型</td>
          <td>{{data.organizationTypeLabel }}</td>
          <td>机构法人姓名</td>
          <td>{{ data.legalPersonName }}</td>
        </tr>
        <tr>
          <td>机构地址</td>
          <td>{{ data.organizationAddress }}</td>
          <td>邮政编码</td>
          <td>{{data.postalCode }}</td>
        </tr>
        <tr>
          <td>机构法人联系电话</td>
          <td>{{data.legalPersonPhone }}</td>
          <td>机构法人身份证号</td>
          <td>{{ data.legalPersonIdCard }}</td>
        </tr>
        <tr>
          <td>机构占地面积</td>
          <td>{{data.landArea }}</td>
          <td>机构使用面积</td>
          <td>{{ data.usableArea }}</td>
        </tr>
        <tr>
          <td>投资总额</td>
          <td>{{ data.investmentAmount }}</td>
          <td>机构负责人姓名</td>
          <td>{{ data.dutyUser }}</td>
        </tr>
        <tr>
          <td>机构负责人联系电话</td>
          <td>{{ data.dutyUserPhone }}</td>
          <td>区核定床位数</td>
          <td>{{ data.approvedBedTotal }}</td>
        </tr>
        <tr>
          <td>资金来源</td>
          <td>{{data.fundingSource }}</td>
          <td>电子邮件</td>
          <td>{{data.email }}</td>
        </tr>
        <tr>
          <td>营业执照(民非)证号</td>
          <td>{{ data.businessLicense }}</td>
          <td>机构设置证号(备案)</td>
          <td>{{ data.organizationFilings }}</td>
        </tr>
        <tr>
          <td>注册资金</td>
          <td>{{ data.registeredCapital }}</td>
          <td>入住率</td>
          <td>{{data.occupancyRate }}%</td>
        </tr>
        <tr>
          <td>开户银行</td>
          <td>{{data.bankName }}</td>
          <td>银行账号</td>
          <td>{{data.bankAccount }}</td>
        </tr>
        <tr>
          <td>领取新增补贴床位数</td>
          <td>{{ data.getSubsidyBedTotal }}</td>
          <td>领取时间</td>
          <td>{{data.getTime }}</td>
        </tr>
    </table>
    <br/>
    <!--  员工概括 -->
    <table align="center" border="1" cellpadding="5" cellspacing="0" width="100%" class="table2">
       <caption>员工概括</caption>
           <tr>
            <td>管理人员数量</td>
            <td>{{ data.managerialStaffTotal }}</td>
            <td>管理人员持证人数</td>
            <td>{{ data.certifiedPersonnelTotal }}</td>
          </tr>
           <tr>
            <td>医技人数</td>
            <td>{{data.medicalTechnicalStaffTotal }}</td>
            <td>护士人数</td>
            <td>{{ data.nurseTotal }}</td>
          </tr>
           <tr>
            <td>护理员数</td>
            <td>{{ data.caregiverTotal }}</td>
            <td>护理员持证人数</td>
            <td>{{ data.caregiverCertifiedTotal }}</td>
          </tr>
           <tr>
            <td>工勤人数</td>
            <td>{{ data.utilityStaffTotal }}</td>
            <td>员工总数</td>
            <td>{{ data.staffTotal }}</td>
          </tr>
    </table>
    <br/> 
     <!-- 申请内容 -->
      <table align="center" border="1" cellpadding="5" cellspacing="0" width="100%" class="table3">
            <caption>申请内容</caption>
             <tr>
              <td>单人间数</td>
              <td>{{ data.singleRoomTotal }}</td>
              <td>双人间数</td>
              <td>{{ data.doubleRoomTotal }}</td>
            </tr>
             <tr>
              <td>三人间数</td>
              <td>{{ data.tripleRoomTotal }}</td>
              <td>多人间数</td>
              <td>{{ data.multiPersonRoomTotal }}</td>
            </tr>
             <tr>
              <td>房间总数</td>
              <td>{{data.roomTotal }}</td>
              <td>床位总数</td>
              <td>{{ data.bedTotal }}</td>
            </tr>
             <tr>
              <td>平均床位建筑面积</td>
              <td>{{ data.averageBedBuildingArea }}</td>
              <td>产权性质</td>
              <td>{{ data.propertyTypeLabel }}</td>
            </tr>
             <tr>
              <td>申报普通型床位</td>
              <td>{{data.generalBedTotal }}</td>
              <td>普通型床位补贴标准</td>
              <td>{{data.generalBedSubsidy }}</td>
            </tr>
             <tr>
              <td>申请补贴金额（普通型）</td>
              <td>{{data.applySubsidyAmount }}</td>
              <td>申请补贴金额（护理型）</td>
              <td>{{ data.applyNurseSubsidyAmount }}</td>
            </tr>
             <tr>
              <td>申请时间</td>
              <td>{{ data.applyTime }}</td>
              <td>申请承办人姓名</td>
              <td>{{ data.applyUndertakerName }}</td>
            </tr>
             <tr>
              <td>申请总金额</td>
              <td colspan="3">{{ data.applySumAmount }}</td>
            </tr>
      </table>
      <br/>
      
      <!-- 审核意见  -->
      <table align="center" border="1" cellpadding="5" cellspacing="0" width="100%" class="table4">
        <caption>审核意见</caption>
        <tr>
          <td rowspan="2">区民政部门意见</td>
          <td rowspan="2">{{ data.civilAdministrationOpinion }}</td>
          <td>区民政局:（章）</td>
        </tr>
        <tr>
          <td>{{ data.civilAdministrationAuditTime }}</td>
        </tr>
        <tr>
            <td rowspan="2">区财政部门意见</td>
            <td rowspan="2">{{ data.treasuryDeptOpinion }}</td>
            <td>区财政部门意见:（章）</td>
          </tr>
          <tr>
            <td>{{ data.treasuryDeptAuditTime }}</td>
          </tr>
      </table>
      <br/>
      <!-- 新增床位审核 -->
      <table align="center" border="1" cellpadding="5" cellspacing="0" width="100%">
          <caption>新增床位审核</caption>
          <caption>房间列表</caption>
          <tr>
            <td style="font-weight: 700;">护理类别</td>
            <td style="font-weight: 700; width: 60px;">姓名</td>
            <td style="font-weight: 700;">身份证号码</td>
            <td style="font-weight: 700;">户籍地区</td>
            <td style="font-weight: 700;">户籍地址</td>
            <td style="font-weight: 700;">入院时间</td>
            <td style="font-weight: 700;">出院时间</td>
            <td style="font-weight: 700;">房号</td>
            <td style="font-weight: 700;">家属电话</td>
          </tr>
          <tr v-for="(item,index) in roomList" :key="index">
            <td>{{ item.nurseTypeLabel }}</td>
            <td>{{ item.name }}</td>
            <td>{{ item.idCard }}</td>
            <td>{{ getAreaObj(item,'cr') }}</td>
            <td>{{ item.crAddress }}</td>
            <td>{{ item.hospitalizedTine }}</td>
            <td>{{ item.dischargedTime }}</td>
            <td>{{ item.roomNumber }}</td>
            <td>{{ item.familyPhone }}</td>
          </tr>
          <tr>
            <td style="font-weight: 700;">区民政检查人姓名</td>
            <td>{{ data.civilAdministrationExamineName }}</td>
            <td style="font-weight: 700;">检查时间</td>
            <td>{{ data.examineTime }}</td>
            <td style="font-weight: 700;">备注</td>
            <td colspan="4">{{ data.remark }}</td>
          </tr>
      </table>
      <br/>
      <!-- 新增床位实地勘察报告 -->
      <table align="center" border="1" cellpadding="5" cellspacing="0" width="100%">
          <caption>新增床位实地勘察报告</caption>
          <tr>
            <td style="font-weight: 700;">项目名称</td>
            <td style="font-weight: 700;">地址</td>
            <td style="font-weight: 700;">面积</td>
            <td style="font-weight: 700;">主要设施</td>
            <td style="font-weight: 700;">内容描述</td>
          </tr>
          <tr v-for="(item,index) in surveyProjectsList" :key="index">
            <td>{{ item.projectName }}</td>
            <td>{{ item.address }}</td>
            <td>{{ item.acreage }}</td>
            <td>{{ item.mainFacility }}</td>
            <td>{{ item.contentDescribe }}</td>
          </tr>
          <tr>
            <td style="font-weight: 700;">堪察人意见</td>
            <td colspan="4">{{ data.reconnaissanceOpinion }}</td>
          </tr>
          <tr>
            <td style="font-weight: 700;">勘察人姓名</td>
            <td colspan="4">{{ data.reconnaissanceName }}</td>
          </tr>
          <tr>
            <td style="font-weight: 700;">勘察时间</td>
            <td colspan="4">{{ data.reconnaissanceTime }}</td>
          </tr>
      </table>
      <br/>
      <!-- 领取第一笔新增床位补贴基本情况 -->
      <table align="center" border="1" cellpadding="5" cellspacing="0" width="100%" class="table7">
          <caption>领取第一笔新增床位补贴基本情况</caption>
          <tr>
            <td>普通型床位领取金额</td>
            <td>{{ data.oneOrdinaryBedSubsidyAmount }}</td>
            <td>普通型床位领取时间</td>
            <td>{{ data.oneOrdinarySubsidyIssueTime }}</td>
          </tr>
          <tr>
            <td>护理型床位领取金额</td>
            <td>{{data.oneNursingBedSubsidyAmount }}</td>
            <td>护理型床位领取时间</td>
            <td>{{ data.oneNursingSubsidyIssueTime }}</td>
          </tr>
      </table>
      <br/>
      <!-- 申请领取第二笔新增床位基本情况 -->
      <table align="center" border="1" cellpadding="5" cellspacing="0" width="100%" class="table8">
          <caption>申请领取第二笔新增床位基本情况</caption>
           <tr>
              <td>入住老人数</td>
              <td>{{ data.checkSumOldman }}</td>
              <td>入住老人与总床位的比例</td>
              <td>{{ data.ratio*100 }}%</td>
            </tr>
            <tr>
              <td>普通型床位领取金额</td>
              <td>{{ data.twoApplySubsidyAmount }}</td>
              <td>护理型床位领取金额</td>
              <td>{{ data.twoApplyNurseSubsidyAmount }}</td>
            </tr>
             <tr>
              <td>总金额</td>
              <td>{{ data.totalAmount }}</td>
              <td>区民政部门意见</td>
              <td>{{ data.twoCivilAdministrationOpinion }}</td>
            </tr>
            <tr>
              <td>区民政部门审核时间</td>
              <td>{{ data.twoCivilAdministrationAuditTime }}</td>
              <td>区财政部门意见</td>
              <td>{{ data.twoTreasuryDeptOpinion }}</td>
            </tr>
             <tr>
              <td>区财政部门审核时间</td>
              <td>{{ data.twoTreasuryDeptAuditTime }}</td>
              <td></td>
              <td></td>
            </tr>
      </table>
      <br/>
      <!-- 改护理型床位补贴申请 -->
      <table align="center" border="1" cellpadding="5" cellspacing="0" width="100%" class="table9">
          <caption>改护理型床位补贴申请</caption>
          <tr>
            <td>申报床位数</td>
            <td>{{data.declareBedNumber}}</td>
            <td>补贴标准</td>
            <td>{{data.subsidyStandard}}</td>
          </tr>
          <tr>
            <td>补贴金额</td>
            <td>{{data.subsidyAmount}}</td>
            <td>申请承办人姓名</td>
            <td>{{data.nurseApplyUndertakerName }}</td>
          </tr>
          <tr>
            <td>申请时间</td>
            <td>{{ data.nurseApplyTime }}</td>
            <td>区民政部门意见</td>
            <td>{{data.nurseCivilAdministrationOpinion }}</td>
          </tr>
          <tr>
            <td>区民政部门审核时间</td>
            <td>{{ data.nurseCivilAdministrationAuditTime }}</td>
            <td>区财政部门意见</td>
            <td>{{ data.nurseTreasuryDeptOpinion }}</td>
          </tr>
          <tr>
            <td>区财政部门审核时间</td>
            <td>{{ data.nurseTreasuryDeptAuditTime }}</td>
            <td></td>
            <td></td>
          </tr>
      </table>
  </div>
</template>

<script setup lang="ts">
import apiMod from '@/apiMod/index'
import {getAreaObj} from '@/utils/util'
// import {getDictLabel} from '../../config'
type Props = {
  nowRowData?: any
}
const props = withDefaults(defineProps<Props>(), {
  nowRowData: {}
})
// 获取所有字典
let dictData = ref([])

const getAllDict = () => {
  let params = ['ORG_TYPE']
  apiMod.getDictItemList(params).then(res=>{
    dictData.value = res.data
    console.log('zidian',res.data)
  })
}
getAllDict()
// const getDictLabel = (dictObj,code,value) =>{
// 	if(dictObj&&code&&value){
// 		let dictList = dictObj[code]
//     console.log('对应字典',dictList)
// 		let obj =  dictList.filter(el=>{
// 			return el.value = value
// 		})
// 		return obj
// 	}
// }

let data:any = reactive({})
data = props.nowRowData
let roomList:any = ref([])
let surveyProjectsList:any = ([])
let key = ref(1)
// 获取房间列表数据
let getroomList=(id)=>{
  apiMod.dpOrgBedSubsidyRoom_page({headId:id,pageParaPO:{size:100000,current:1}}).then(res=>{
     roomList = res.data.records
     key.value = Math.random()
  })
}
let getSurveyProjectsList = (id) => {
  apiMod.dpOrgBedSubsidyReconnaissance_page({ headId:id,pageParaPO:{size:1000000,current:1}}).then(res => {
    surveyProjectsList = res.data.records
    key.value = Math.random()
  })
}
getroomList(props.nowRowData.soleValue)
getSurveyProjectsList(props.nowRowData.soleValue)
</script>
<style scoped lang="scss">
.table1>tr>td:nth-child(odd) {
  font-weight: 700;
}
.table2>tr>td:nth-child(odd) {
  font-weight: 700;
}
.table3>tr>td:nth-child(odd) {
  font-weight: 700;
}
.table4>tr>td:nth-child(odd) {
  font-weight: 700;
}
.table5>tr>td:nth-child(odd) {
  font-weight: 700;
}
.table6>tr>td:nth-child(odd) {
  font-weight: 700;
}
.table7>tr>td:nth-child(odd) {
  font-weight: 700;
}
.table8>tr>td:nth-child(odd) {
  font-weight: 700;
}
.table9>tr>td:nth-child(odd) {
  font-weight: 700;
}
</style>